/**
 * Created by DukeCrushIt on 2015/8/27.
 */
//module game{
    class SignPanel extends eui.Component{
        public signItem:SignItemRender;
        public constructor(){
            super();
            this.skinName = "skins.scene.SignPanelSkin";
            this.y = 40;
            this.x = 10;
        }

        private onSign(evt:egret.TouchEvent){
            SoundMgr.getInstance().playEffect(SoundMgr.BTN);
            window["__sign"]();
        }

        public updateDisplay(){
            this.lab_comment.text = Model.resetDays + "天后清空签到数据";
            if( this.signItem != null){
                this.signItem.dataChanged();
                this.signItem = null;
            }else{
                this.signList.dataProvider = new eui.ArrayCollection([0,0,0,0,0,0,0,0]);
            }
        }

        public signList:eui.List;
        public lab_comment:eui.Label;

        public partAdded(name:string, instance:any){
            super.partAdded(name, instance);
            if( name == "signList"){
                this.signList = instance;
                this.signList.itemRenderer = SignItemRender;
            }else if( name == "lab_comment"){
                this.lab_comment = instance;
            }
        }

        private static _instance:SignPanel;
        public static getInstance():SignPanel{
            if( SignPanel._instance == null)
                SignPanel._instance = new SignPanel();
            return SignPanel._instance;
        }
    }
//}